<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function arr(s) {
      let len = s.length;
      if (len % 2 !== 0) {
        return false;
      }
      let length = len / 2;
      for (let i = 0; i < length; i++) {
        s = s.replace("()", "");
        s = s.replace("{}", "");
        s = s.replace("[]", "");
      }
      return s.length === 0;
    };
    console.log(arr('()()(){}{}{}[]'));
  </script>
</body>

</html>